<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <div class="datalist"><table id="flexigrid" style="display:none"></table></div>
        <script type="text/javascript">
            $(function() {
                $("#flexigrid").flexigrid($.extend(SG.flexOptions, {
                    url: '<?= site_url('general/notice/flexigrid') ?>',
                    colModel: [
                        {display: 'ID', name: 'id', width: '60', iskey: true},
                        {display: '<?= translate('TITLE') ?>', name: 'title', width: '200', process: formatSearch},
                        {display: '<?= translate('CONTENT') ?>', name: 'content', width: '420', sortable: false},
                        {display: '<?= translate('GENERAL_NOTICE_VIEWS') ?>', name: 'views', width: '8%'},
                        {display: '<?= translate('AUTHOR') ?>', name: 'author', width: '100', process: formatSearch},
                        {display: '<?= translate('CREATETIME') ?>', name: 'createtime', width: '120'},
                        {display: '<?= translate('STARTTIME') ?>', name: 'starttime', width: 120},
                        {display: '<?= translate('EXPIRETIME') ?>', name: 'expiretime', width: 120},
                        {display: '<?= translate('WEIGH') ?>', name: 'weigh', width: '8%', hide: true},
                        {display: '<?= translate('STATUS') ?>', name: 'state', width: '8%', process: formatState},
                        {display: '<?= translate('MANAGE') ?>', name: 'id', width: '140', sortable: false, process: formatOp},
                    ],
                    buttons: [
                        {name: 'add', displayname: "<?= translate('ADD') ?>", title: "<?= translate('ADD') ?>", bclass: 'add', onpress: multi},
                        {name: 'delete', displayname: "<?= translate('DEL') ?>", title: "<?= translate('DEL') ?>", bclass: 'delete', onpress: multi},
                        {name: 'reject', displayname: "<?= translate('CLOSE') ?>", bclass: 'reject', onpress: multi},
                        {name: 'accept', displayname: "<?= translate('OPEN') ?>", bclass: 'accept', onpress: multi},
                        {name: 'export', displayname: "<?= translate('EXPORT') ?>", bclass: 'export', onpress: multi},
                        {separator: true},
                    ],
                    searchitems: true,
                    sortname: 'weigh',
                    sortorder: 'desc',
                }));
                SG.admin = $.extend(SG.admin, {
                    add_url: '<?= site_url("general/notice/add/") ?>',
                    edit_url: '<?= site_url("general/notice/edit/") ?>',
                    del_url: '<?= site_url("general/notice/del/") ?>',
                    multi_url: '<?= site_url("general/notice/multi/") ?>',
                    table: '{pre}notice'
                });
            });
        </script>
    </body>
</html>